# 统计不同分数出现的次数 [70,64,63,76,54,54,34,5,6,54,34,70,76,80,96,78,56,34,76,66,32,43,21,32,12,98,67,73,40,92]
# 列表中总共有多少个分数,每个分数出现多少次?


#集合 是无序不重复的!!
# list_01 = [70,64,63,76,54,54,34,5,6,54,34,70,76,80,96,78,56,34,76,66,32,43,21,32,12,98,67,73,40,92]
# set_01 = set(list_01)
# dict_01 = {}
# for i in set_01:
#     dict_01[i] = list_01.count(i)
# print(dict_01)


# 寻找字符串中出现最多的字符(忽略大小写)
# str_01 = "HjLnLECcifOAhXxxtnAFyQAnSsfajlkhadfsslkfhdaslkdhalksdcISgpqVvoZMWppGViTddbRsibEiCXSmDKVhXBPHzVlvVDLIeqNbjpAYnEUaFRJdNZlZOmiFcGhaVtCJXhKsQKyXRZPoWQDHTnSkqUcvtiUwVEVffXbNPURbMwfKpqxVQOhCShhxHEnRcVWiPLGCcZYBnmaiKhMVzTMYvotdABmQwldrROiqdbnIUUxSgzcnfAiJSoxZUlmddMjmovDDpXKSucLYQELwcVgYjiUqNCeiVCYhRUHTYfsBSniTxohigUUBYKEPSKznAHyxKC"
# str_01 = str_01.lower()
# set_01 = set(str_01)
# flag = 0 # 出现最多的那个字符出现的次数
# char = "" # 出现最多的那个字符
# for i in set_01:
#     print(i,str_01.count(i))
#     count = str_01.count(i)
#     if count > flag:
#         flag = count
#         char = i
# print(flag,char)

# 如果出现的次数一样怎么办?
str_01 = "HjLnLECcifOAhXxxtnAFiiisvyQAnSsfajlkhadfsslkfhdaslkdhalksdcISgpqVvoZMWppGViTddbRsibEiCXSmDKVhXBPHzVlvVDLIeqNbjpAYnEUaFRJdNZlZOmiFcGhaVtCJXhKsQKyXRZPoWQDHTnSkqUcvtiUwVEVffXbNPURbMwfKpqxVQOhCShhxHEnRcVWiPLGCcZYBnmaiKhMVzTMYvotdABmQwldrROiqdbnIUUxSgzcnfAiJSoxZUlmddMjmovDDpXKSucLYQELwcVgYjiUqNCeiVCYhRUHTYfsBSniTxohigUUBYKEPSKznAHyxKC"
str_01 = str_01.lower()
set_01 = set(str_01)
flag = 0 # 出现最多的那个字符出现的次数
char_list = [] # 出现最多的那个字符
for i in set_01:
    print(i,str_01.count(i))
    count = str_01.count(i)
    if count > flag:
        flag = count
        #如果新字符的出现次数大于上一次最大的 清空,放当前的
        char_list.clear()
        char_list.append(i)
    elif count == flag:
        # 如果新字符的出现次数等于上一次最大的 追加
        char_list.append(i)
